home *** CD-ROM | disk | FTP | other *** search
/ MacWorld 1998 May / Macworld (1998-05).dmg / Serious Demos / Lasso 2.5 Test Drive / Lasso 2.5 Plug-in / Employees / search3.lasso < prev    next >
Text File  |  1997-12-12  |  15KB  |  386 lines

  1. <!--
  2.  
  3. This is a sample search file for use with Lasso. Lasso is used in conjunction with Mac OS Web servers to publish FileMaker Pro databases on the web.
  4.  
  5. Lasso is a product of Blue World Communications, Inc. Information is available at http://www.blueworld.com/lasso/
  6.  
  7. Lasso operates by interpreting 'Lasso Tags' placed in HTML 'format' files such as this. There are five types of Lasso tags: action, command, substitution, container, and sub-container. Lasso action and command tags are preceded by a dash. While substitution, container, and sub-container are surrounded by square brackets. All Lasso tags are not case sensitive. That is, Lasso will recognize  "-DATABASE" or "-database" "-DaTaBaSe"; or [server_date], [SERVER_DATE], or [SeRveR_dAtE].
  8.  
  9.  
  10. -->
  11.  
  12. <html>
  13. <head>
  14. <title>Lasso - Search Sample Employees Database</title>
  15. </head>
  16. <body bgcolor=#ffffd9>
  17. <center>
  18. <h2>Lasso: Search the Sample Employees Database</h2>
  19.  
  20. </center>
  21.  
  22. <P align="center">This is an example of how to use Lasso to search a FileMaker Pro database.
  23. <P align="center">The name of this file is
  24. <strong>Search3.html</strong>; you'll find useful comments in it.
  25. <center>
  26.  
  27. <!--
  28. The inline tag is used to specify the Lasso action that is to occur. In this case it is simply the "show" action which instructs Lasso to gather information from the specified database.
  29. -->
  30.  
  31. [inline: database="Employees.fp3",layout="Detail",show]
  32.  
  33.  
  34. <!-- Setting action="action.lasso" causes the Web server to direct processing to the Lasso Plug-in or Server. The slash indicates that the Lasso application is located at the root level and all format files should be specified from that location. Without the slash all format files are relative to the base URL-->
  35.  
  36. <form action="action.lasso" method="POST">
  37.  
  38. <!-- The "database" tag tells Lasso which FileMaker Pro database to use; the name is not case sensitive. This tag is required. -->
  39.  
  40. <input type="hidden" name="-database" value="Employees.fp3">
  41.  
  42. <!-- The "layout" tag tells Lasso which layout in the database to use; the name is not case sensitive. Specifying a layout is optional; if omitted, Lasso will use layout 0 of the database.
  43.  
  44. If specified, the layout must contain all fields specified in this form, AND all fields specifed in the format file (see discussion of the "-response" tag, below).
  45.  
  46. Specifying a layout is faster than using layout 0 because Lasso retrieves data for all fields in the layout, even if they're not used in the result page format file. Letting Lasso default to layout 0 is less error prone because it uses all fields in the database.  -->
  47.  
  48. <input type="hidden" name="-layout" value="Summary">
  49.  
  50. <!-- The -noResults tag specifies an HTML file for Lasso to display if no records are found as a result of the search. This field is optional. If omitted, Lasso displays a default "No Results" page. -->
  51.  
  52. <input type="hidden" name="-noResults" value="no_results.html">
  53.  
  54. <!-- Below here are the input fields for the search values. The names must match the FileMaker Pro field names exactly, but are not case sensitive. Any field can be left blank to tell Lasso to ignore that field.
  55.  
  56. The [operator] or -operator command tag, which can also be abbreviated [op] or -op, tells Lasso how to compare the value field to find matches. The default is "begins with" (similar to FileMaker Pro's default search operator). If an option list is specified, the default value is the first
  57.                 <option> item in the list, unless the attribute 'selected' is used to indicate the default. You may also use operator in a hidden input field if you'd like. The -operator tag only affects the search field that immediately follows. It defaults back to "begins with" after that search field.
  58.  
  59. The values for -operator must appear exactly as in this example, but are not case sensitive. Alternately, abbreviations may be used for the operator values may be specified in the option tag. This allows use of alternate text to display to the end user. This example uses Lasso abbreviations for the operator values (German translations provided by Marco Galli):
  60.  
  61.     <select name="-operator">
  62.                     <option value="eq"> ist gleich
  63.                     <option value="ct"> enthält
  64.                     <option value="bw"> beginnt mit
  65.                     <option value="ew"> endet mit
  66.                     <option value="gt"> grösser als
  67.                     <option value="gte"> grösser als oder gleich
  68.                     <option value="lt"> kleiner als
  69.                     <option value="lte"> kleiner als oder gleich
  70.             </select>
  71.  
  72. This form shows examples of text input, menus, and radio buttons to specify field values. -->
  73.  
  74. <table border=0>
  75. <tr>
  76.     <td bgcolor=#d7bf89><p align=right><b>First Name</b>    </td>
  77.     <td><select name="-op">
  78.                     <option>begins with
  79.                 <option>equals
  80.                 <option>not equals
  81.                 <option>contains
  82.                 <option>ends with
  83.         </select>
  84.     </td>
  85.     <td><input type=text size=30 name="First Name">    </td>
  86. </tr>
  87. <tr>
  88.     <td bgcolor=#d7bf89><p align=right><b>Last Name</b>    </td>
  89.     <td>    <select name="-op">
  90.                 <option>begins with
  91.                 <option>equals
  92.                 <option>not equals
  93.                 <option>contains
  94.                 <option>ends with
  95.         </select>
  96.     </td>
  97.     <td><input type=text size=30 name="Last Name">    </td>
  98. </tr>
  99. <tr>
  100.     <td bgcolor=#d7bf89><p align=right><b>Employee Number</b>    </td>
  101.  
  102. <!-- The operators "contains", "begins with", and "ends with" don't make sense for numeric fields, therefore we don't offer them as options here. Note the use of the HTML encodings > for > and < for
  103. < . -->
  104.  
  105.     <td><select name="-op">
  106.             <option value="eq" selected> equals
  107.             <option value="neq"> not equals
  108.             <option value="gt"> >
  109.             <option value="gte"> > or =
  110.             <option value="lt"> <
  111.             <option value="lte"> < or =
  112.         </select>
  113.     </td>
  114.     <td><input type=text size=30 name="Employee Number">    </td>
  115. </tr>
  116. <tr>
  117.     <td bgcolor=#d7bf89><p align=right><b>Email</b>    </td>
  118.     <td>    <select name="-op">
  119.                     <option>begins with
  120.                 <option>equals
  121.                 <option>not equals
  122.                 <option>contains
  123.                 <option>ends with
  124.     </select>
  125.     </td>
  126.     <td><input type=text size=30 name="Email">    </td>
  127. </tr>
  128. <tr>
  129.     <td bgcolor=#d7bf89><p align=right><b>Comments</b>    </td>
  130.     <td>    <select name="-op" size=1>
  131.                 <option>contains
  132.                 <option>begins with
  133.                 <option>equals
  134.                 <option>not equals
  135.                 <option>ends with
  136.         </select>
  137.     </td>
  138.     <td><input type=text size=30 name="Comments">    </td>
  139. </tr>
  140. <tr>
  141.     <td bgcolor=#d7bf89><p align=right><b>Date Last Modified</b>    </td>
  142.     <td>    <select name="-op">
  143.             <option value="eq"> equals
  144.             <option value="neq"> not equals
  145.             <option value="gt"> >
  146.             <option value="gte" selected> > or =
  147.             <option value="lt"> <
  148.             <option value="lte"> < or =
  149.         </select>
  150.     </td>
  151.     <td><input type=text size=30 name="Edit Date">    </td>
  152. </tr>
  153. <tr>
  154. <!-- The [option: Field Name] tag can be used to format fields that contain value lists as HTML pop-up/pull-down menus. Lasso will substitute HTML in the form:
  155.  
  156.                 <option>List Value
  157.  
  158. for every value in the value list. Note that a "blank" selection is provided in the pop-up menu so that the user can choose not to specify a value for this field. -->
  159.  
  160.     <td bgcolor=#d7bf89><p align=right><b>Group</b>    </td>
  161.     <td colspan=2><select name="Group">
  162.             <option value="" selected>None [option: "Group"]
  163.         </select>
  164.     
  165. <!-- Field-level operators are possible using the "-opbegin" and "-opend" tags to specify that whatever is selected for this particular entry, not be included in this search. It is also possible to include two fields and require that they both be included (an "and" logical operator) while the rest of the search form uses the "or" logical operator. -->
  166.  
  167.  <b>Not:</b>
  168.     
  169.     <input type="hidden" name="-opbegin" value="not">
  170.         <select name="Group">
  171.             <option value="" selected>- - omit group - -
  172.          [option: "Group"]
  173.         </select>
  174.     <input type="hidden" name="-opend">
  175.  
  176.     </td>
  177. </tr>
  178. <tr>
  179.     <td valign="top" bgcolor=#d7bf89><p align=right>
  180. <b>Shift</b>    </td>
  181.     <td colspan=2>
  182. <input type=radio name="Shift" value="" checked>None [value_list:"Shift"]
  183. <input type="radio" name="Shift" value="[list_value]">[list_value] [/value_list]    
  184.     </td>
  185. </tr>
  186.  
  187.  
  188. <tr>
  189.     <td valign="top" bgcolor=#d7bf89><p align=right>
  190. <b>Favorite Colored Dot</b>    </td>
  191.     <td colspan=2>
  192.  
  193. <input type=hidden name="-op" value="eq">
  194. <input type=radio name="Favorite Colored Dot" value="" checked>None
  195. <input type=radio name="Favorite Colored Dot" value="green_dot.gif">
  196. <img src="green_dot.gif"> Green
  197. <input type=radio name="Favorite Colored Dot" value="purple_dot.gif">
  198. <img src="purple_dot.gif"> Purple
  199. <input type=radio name="Favorite Colored Dot" value="red_dot.gif">
  200. <img src="red_dot.gif"> Red
  201.     </td>
  202. </tr>
  203. <tr>
  204.     <td valign="top" bgcolor=#d7bf89><p align=right>
  205.  
  206. <!-- The [value_list: Field Name] tag can be used to format fields that contain value lists as a set of radio buttons or checkboxes. All HTML between the [value_list: Field Name] and [/value_list] tags is repeated for every value in the value list. The actual list value is substitued for the [list_value] tag.  -->
  207.  
  208. <b>Nice Traits</b>    </td>
  209.     <td colspan=2> 
  210. [value_list: "Nice Traits"]
  211. <input type="checkbox" name="Nice Traits" value="[list_value]">[list_value] [/value_list]
  212.     </td>
  213. </tr>
  214.  
  215.  
  216. <tr>
  217.  
  218. <!-- Searches on numeric and date ranges can be accomplished by providing two values for the field with appropriate comparison operators. Note that an operator must be used with fields that are defined as date or time and that only the equals, greater than (equals), or less than (equals) opertors can be used with these type of fields. -->
  219.  
  220.     <td bgcolor=#d7bf89><p align=right><b>Hire Date</b>    </td>
  221.     <td colspan=2>
  222. <select name="-op">
  223.             <option value="gte"> from
  224.             <option value="gt"> after
  225.         </select>
  226. <input type=text name="Hire Date" size=10>
  227. <select name="-op">
  228.             <option value="lte"> to
  229.             <option value="lt"> before
  230.         </select>
  231. <input type=text name="Hire Date" size=10>
  232.     </td>
  233. </tr>
  234.  
  235.  
  236.  
  237. <tr>    <td colspan=3><hr>    </td></tr>
  238.  
  239. <tr>
  240.  
  241. <tr>
  242.  
  243. <!-- The "logicalop" tag can be used to specify whether Lasso performs an AND or an OR search for all field values. This is an optional tag; if not specified, the default is AND.  -->
  244.  
  245.     <td bgcolor=#d7bf89><p align=right><b>Logical Operator</b>    </td>
  246.     <td>
  247. <input type=radio name="-logicalop" value="and" checked>AND
  248. <input type=radio name="-logicalop" value="or">OR    </td>
  249.  
  250. <!-- The "maxRecords" tag limits the number of records returned by Lasso. Specifying "all" tells Lasso to return all records. There is no limit imposed by Lasso on the number of records that can be returned. However, a perception of faster performance will be given by returning a small number of records, and using "[next]" links to view successive pages. See the file "hitlist_format.html" for a discussion of "[next]" links.
  251.  
  252. The 72K byte limit can be increased by increasing the memory partition in the "Get Info" box for the Web Server. -->
  253.  
  254.     <td><b>Return</b>
  255.         <select name="-maxRecords">
  256.             <option>5
  257.             <option selected>10
  258.             <option>20
  259.             <option>30
  260.             <option>50
  261.             <option>all
  262.         </select>
  263. <b>records per page
  264.     </td>
  265. </tr>
  266.  
  267. <!-- The "sortfield" tag tells Lasso which field to sort the results on. It is optional. The value of "Unsorted" (not case sensitive) is recognized by Lasso or the field can be left without any value to leave records unsorted.
  268.  
  269. There is no limit to the number of sort fields that can be specified by the "sortfield" tag. If multiple tags appear, the sorts will be nested in the order in which they appear on the search form.  -->
  270.  
  271. <tr>
  272.     <td bgcolor=#d7bf89><p align=right><b>Sort By</b>    </td>
  273.     <td><select name="-sortfield">
  274.                 <option VALUE="" SELECTED>- Select -
  275.                 <option>unsorted
  276.                 <option>First Name
  277.                 <option>Last Name
  278.                 <option>Employee Number
  279.                 <option>Hire Date
  280.                 <option>Group
  281.                 <option>Shift
  282.         </select>
  283.     </td>
  284.  
  285. <!-- The -sortordertag applies to the immediately preceding -sortfield. This tag is optional and defaults to "ascending". The value "custom" can be used for fields that contain value list to sort in value list order. -->
  286.  
  287.     <td><select name="-sortorder">
  288.             <option selected>ascending
  289.                 <option>descending
  290.         </select>
  291.     </td>
  292. </tr>
  293. <tr>
  294.     <td bgcolor=#d7bf89><p align=right><b>Sort By</b>    </td>
  295.     <td><select name="-sortfield">
  296.                 <option VALUE="" SELECTED>- Select -
  297.                 <option>unsorted
  298.                 <option>First Name
  299.                 <option>Last Name
  300.                 <option>Employee Number
  301.                 <option>Hire Date
  302.                 <option>Group
  303.                 <option>Shift
  304.         </select>
  305.     </td>
  306.     <td><select name="-sortorder">
  307.             <option selected>ascending
  308.                 <option>descending
  309.         </select>
  310.     </td>
  311. </tr><tr>
  312.     <td bgcolor=#d7bf89><p align=right><b>Response Layout</b>    </td>
  313.  
  314.     <td colspan="2">
  315. <!-- The "response" tag tells Lasso which format file to use for formatting output. There can be one or more hitlist format files to display the search results. And, the user can be given the option to select which hitlist format file to display. For example, you could have a long form to display a lot of fields, and a short form to display limited fields for a set of records. The following syntax shows how to creating radio buttons for selecting the preferred hitlist.
  316.  
  317. Alternately, the "response" tag can be specified in a hidden input field if no choice is to be given to the user for formatting search results. -->
  318.  
  319. <input type=radio name="-response" value="hitlist_format.html" checked>Standard Hitlist    
  320. <input type=radio name="-response" value="hitlist2_format.html">Alternate Hitlist
  321.     </td>
  322.  
  323. </tr>
  324. <tr>    <td colspan=3><hr>    </td></tr>
  325. </table>
  326.  
  327.  
  328. <p>
  329. <!-- Clicking the "search" button causes Lasso to conduct a database search based on the criteria specified by the user in this form. The value of this button can be anything. -->
  330.  
  331. <input type="Submit" name="-search" value="Start Search">
  332.  
  333. <!-- Clicking the "findall" button causes Lasso to return all records in the database, regardless of the criteria specified in this form. The "sortfield," "sortorder," and "maxRecords" values will be applied to the returned records. The value of this button can be anything. -->
  334.  
  335. <input type="Submit" name="-findall" value="Find All">
  336.  
  337. <!-- The reset button has no effect on Lasso, it merely clears the current form. Reset does not change field information stored in the FileMaker Pro database -->
  338.  
  339. <input type="Reset" value="Clear this form">
  340.  
  341.  
  342. </form>
  343. </center>
  344.  
  345. <!-- The [include] tag instructs Lasso to parse and insert the output HTML from the specified format file into the HTML for this format file. -->
  346.  
  347. <p>
  348. <center>
  349. <b><a href="action.lasso?-database=Employees.fp3&-layout=Detail&-response=Search.html&-show">[ Search Database ]</a></b>  
  350.  
  351. <b><a href="action.lasso?-database=Employees.fp3&-layout=Detail&-response=Add.html&-show">[ Add Record ]</a></b>
  352.  
  353. <b><a href="action.lasso?-database=Employees.fp3&-layout=Detail&-response=random_reply.html&-random">[ Get Random Record ]</a></b>
  354.  
  355. <hr>
  356. <a href="http://www.blueworld.com/lasso/">
  357. <img src="lassologo.gif" border=0 alt="Lasso Home Page"></a>
  358. <hr>
  359. <TABLE>
  360. <TR>
  361.     <TD align=right bgcolor=#d7bf89><B>Client Address:</B></TD>
  362.     <TD bgcolor=#ffffff>[client_addr]</TD>
  363. </TR>
  364. <TR>
  365.     <TD align=right bgcolor=#d7bf89><B>Client IP:</B></TD>
  366.     <TD bgcolor=#ffffff>[client_ip]</TD>
  367. </TR>
  368. <TR>
  369.     <TD align=right bgcolor=#d7bf89><B>Client Type:</B></TD>
  370.     <TD bgcolor=#ffffff>[client_type]</TD>
  371. </TR>
  372. <tr>
  373.     <td align=right bgcolor=#d7bf89><B>Server Date:</B></td>
  374.     <td bgcolor=#ffffff>[server_date, long]</td>
  375. </tr>
  376. <tr>
  377.     <td align=right bgcolor=#d7bf89><B>Server Time:</B></td>
  378.     <td bgcolor=#ffffff>[server_time, long]</td>
  379. </tr>
  380. </TABLE>
  381. </center>
  382.  
  383. </body>
  384. </html>
  385. [/inline]
  386.